﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Global.Master" AutoEventWireup="true" CodeBehind="ClientesShowTable.aspx.cs" Inherits="WebAsbesto.Clientes_Agregar" %>


<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>


<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table class="auto-style2" align="center">
        <tr>
            <td colspan="2" style="height: 66px">
                <asp:Label ID="lbl_Titulo" runat="server" Style="text-align: center" Text="Clientes" Font-Size="25" ForeColor="Green"></asp:Label>
                <asp:ScriptManager ID="ScriptManager1" runat="server">
                </asp:ScriptManager>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lbl_Razon_Social" runat="server" Text="Razon Social: "></asp:Label>
            </td>
            <td>
                <asp:DropDownList ID="ddl_Razon_Social" runat="server" DataSourceID="OdRazonSocial" DataTextField="Razon_Social" DataValueField="Razon_Social">
                </asp:DropDownList>
                <asp:SqlDataSource ID="OdRazonSocial" runat="server" ConnectionString="<%$ ConnectionStrings:AsbestoConnectionString %>" SelectCommand="SELECT Razon_Social FROM Clientes"></asp:SqlDataSource>
            </td>
        </tr>
        <tr>
            <td style="height: 26px">
                <asp:Label ID="lbl_CUIT" runat="server" Text="CUIT: " Visible="False"></asp:Label>
            </td>
            <td style="height: 26px">
                <asp:TextBox ID="txt_CUIT" runat="server" Visible="False"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <asp:Button ID="btn_Ingresar_Nuevo_Cliente" runat="server" Text="Nuevo" OnClick="btn_Ingresar_Nuevo_Cliente_Click" />

                <asp:Button ID="btn_Buscar" runat="server" Text="Buscar" OnClick="btn_Buscar_Click" />
            </td>
        </tr>
    </table>
    <div align="center">
        <asp:GridView ID="Grd_Datos_Cliente" runat="server" AutoGenerateColumns="False" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="4" DataSourceID="SqlDataSource1" ForeColor="Black" GridLines="Horizontal" AllowSorting="True" DataKeyNames="Id_Cliente" >
            <Columns>
                <asp:BoundField DataField="Id_Cliente" HeaderText="Id Cliente" InsertVisible="False" ReadOnly="True" SortExpression="Id_Cliente" />
                <asp:BoundField DataField="Razon_Social" HeaderText="Razon Social" SortExpression="Razon_Social" />
                <asp:BoundField DataField="Direccion_Cede_Central" HeaderText="Direccion" SortExpression="Direccion_Cede_Central" />
                <asp:BoundField DataField="CUIT" HeaderText="CUIT" SortExpression="CUIT" />
                <asp:BoundField DataField="Rubro" HeaderText="Rubro" SortExpression="Rubro" />
                <asp:BoundField DataField="Nota" HeaderText="Nota" SortExpression="Nota" />
                <asp:CommandField ButtonType="Image" CancelImageUrl="~/Images/cancelar.png" DeleteImageUrl="~/Images/Eliminar.gif" EditImageUrl="~/Images/editar.png" ShowDeleteButton="True" ShowEditButton="True" UpdateImageUrl="~/Images/Aceptar.png" />
            </Columns>
            <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
            <HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" />
            <SelectedRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#F7F7F7" />
            <SortedAscendingHeaderStyle BackColor="#4B4B4B" />
            <SortedDescendingCellStyle BackColor="#E5E5E5" />
            <SortedDescendingHeaderStyle BackColor="#242121" />
        </asp:GridView>
    </div>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:AsbestoConnectionString %>" DeleteCommand="Clientes_B" DeleteCommandType="StoredProcedure" InsertCommand="Clientes_A" InsertCommandType="StoredProcedure" SelectCommand="Clientes_L" SelectCommandType="StoredProcedure" UpdateCommand="Clientes_M" UpdateCommandType="StoredProcedure">
        <DeleteParameters>
            <asp:Parameter Name="Id_Cliente" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="Razon_Social" Type="String" />
            <asp:Parameter Name="Direccion_Cede_Central" Type="String" />
            <asp:Parameter Name="CUIT" Type="String" />
            <asp:Parameter Name="Rubro" Type="String" />
            <asp:Parameter Name="Nota" Type="String" />
        </InsertParameters>
        <SelectParameters>
            <asp:ControlParameter ControlID="ddl_Razon_Social" Name="Razon_Social" PropertyName="SelectedValue" Type="String" DefaultValue=" " />
            <asp:ControlParameter ControlID="txt_CUIT" Name="CUIT" PropertyName="Text" Type="String" DefaultValue=" " />
        </SelectParameters>
        <UpdateParameters>
            <asp:Parameter Name="Id_Cliente" Type="Int32" />
            <asp:Parameter Name="Razon_Social" Type="String" />
            <asp:Parameter Name="Direccion_Cede_Central" Type="String" />
            <asp:Parameter Name="CUIT" Type="String" />
            <asp:Parameter Name="Rubro" Type="String" />
            <asp:Parameter Name="Nota" Type="String" />
        </UpdateParameters>
    </asp:SqlDataSource>

    <br />

</asp:Content>
